package cn.wolfcode.trip.base.mapper;

import cn.wolfcode.trip.base.domain.StrategyCatalog;
import cn.wolfcode.trip.base.domain.StrategyComment;
import cn.wolfcode.trip.base.query.QueryObject;
import cn.wolfcode.trip.base.query.StrategyCommentQueryObject;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface StrategyCommentMapper {
    int deleteByPrimaryKey(Long id);

    int insert(StrategyComment record);

    StrategyComment selectByPrimaryKey(Long id);

    List<StrategyComment> selectAll();

    int updateByPrimaryKey(StrategyComment record);

    /**
     *查询某个攻略的评论  + 分页
     * @param qo
     * @return
     */
    List<StrategyComment> selectCommentByStrategyId(QueryObject qo);

    /**
     * 保存评论与标签的关系
     * @param commentId : 评论id
     * @param tagId : 标签id
     */
    void insertCommentAndTagRelation(@Param("commentId") Long commentId, @Param("tagId") Long tagId);

    /**
     * 获取常用标签
     * @param qo : 确定数量
     * @return
     */
    List<Map> selectTags(QueryObject qo);

    /**
     * 获取单个攻略
     * @param id 攻略id
     * @return
     */
    StrategyComment selectByCommentId(Long id);

    /**
     * 获取某个用户的点评
     * @param qo
     * @return
     */
    List<StrategyComment> selectCommentsByUserId(StrategyCommentQueryObject qo);
}